wayland: do not set PRIMARY selection if focus is lost
authorOlivier Fourdan <ofourdan@redhat.com>
Mon, 20 Jun 2016 13:52:32 +0000 (15:52 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 20 Jun 2016 18:13:29 +0000 (14:13 -0400)
If keyboard focus is (already) lost, do not advertise PRIMARY selection.

https://bugzilla.gnome.org/show_bug.cgi?id=767848

gdk/wayland/gdkdevice-wayland.c

index b19fd64b9634349ae2bfbc31030952b0639955dd..72d9baf5a66424008f518e52acd005b1cbfa6b7a 100644 (file)
@@ -1058,6 +1058,9 @@ primary_selection_selection (void                                *data,
   GdkWaylandSeat *seat = data;
   GdkAtom selection;
 
+  if (!seat->keyboard_focus)
+    return;
+
   GDK_NOTE (EVENTS,
             g_message ("primary selection selection, device %p, data offer %p",
                        gtk_primary_selection_device, gtk_primary_offer));